<!-- 个人信息页面（名片页面） -->
<template>
  <view class="main">
    <view class="top_tou">
      <view class="left_" @tap="handleTui">
        <image
          src="../../images/circle/zuojiantou.png"
          mode="aspectFill"
        ></image>
      </view>
      <view class="center_"> 个人名片</view>
      <view class="right_"></view>
    </view>
    <view class="content">
      <view class="photo">
        <image class="tou" :src="cardData.avatarUrl" mode="aspectFill"></image>
        <image
          class="v"
          v-if="cardData.verified"
          src="../../images/circle/v.png"
          mode="aspectFill"
        ></image>
      </view>
      <view class="name">
        {{ cardData.realName }}
      </view>
      <view class="xinxi">
        <text class="company">{{ cardData.company }}</text>
        <text class="zhiwei">{{ cardData.post }}</text>
      </view>
      <view class="tab">
        <view class="zuzhi">
          <text>组织</text>
          <text class="t1">{{ cardData.orgNumber }}</text>
        </view>
        <view class="quanzi">
          <text>圈子</text>
          <text class="t1">{{ cardData.friendNumber }}</text>
        </view>
        <view class="card">
          <text>名片</text>
          <text class="t1">{{ cardData.cardNumber }}</text>
        </view>
      </view>
      <view class="message">
        <image
          src="../../imges/card_shang.png"
          mode="aspectFill"
          class="openMore1"
          v-if="isMore && cardNewInfoList.length > 2"
          @tap="hanldeLess"
        ></image>
        <image
          src="../../imges/card_xia.png"
          mode="aspectFill"
          class="openMore"
          v-if="!isMore && cardNewInfoList.length > 2"
          @tap="hanldeMore"
        ></image>
        <view
          class="renzhen"
          v-for="(item, index) in cardInfoList"
          :key="index"
          v-if="item.name"
        >
          <img :src="item.imgUrl" />
          <view :class="[item.title != '简介：' ? 'row' : 'row1']">
            <text class="title">{{ item.title }}</text>
            <text class="brief">{{ item.name }}</text>
          </view>
        </view>
        <!-- 			<view class="dengji">
				<image src="../../images/circle/dengji.png" mode="aspectFill"></image>
				<view class="">
					等级：<text>Lv2</text>
				</view>
			</view>
			
			<view class="city">
				<image src="../../images/circle/city.png" mode="aspectFill"></image>
				<view class="">
					城市：<text>山东省 青岛市</text>
				</view>
			</view>
	
			<view class="company">
				<image src="../../images/circle/company.png" mode="aspectFill"></image>
				<view class="">
					公司：<text>青岛一起来往网络科技有限公司</text>
				</view>
			</view>
			<view class="hangye">
				<image src="../../images/circle/hangye.png" mode="aspectFill"></image>
				<view class="">
					行业：<text>房地产</text>
				</view>
			</view>
			<view class="post">
				<image src="../../images/circle/post.png" mode="aspectFill"></image>
				<view class="">
					职位：<text>CEO</text>
				</view>
			</view>
			<view class="email">
				<image src="../../images/circle/email.png" mode="aspectFill"></image>
				<view class="">
					邮箱：<text>yiqilaiwang@qq.com</text>
				</view>
			</view>
			<view class="sr">
				<image src="../../images/circle/sr.png" mode="aspectFill"></image>
				<view class="">
					生日：<text>1991 / 03 / 01</text>
				</view>
			</view>
			<view class="jianjie">
				<image src="../../images/circle/jianjie.png" mode="aspectFill"></image>
				<view class="">
					简介：<text>这是我的个人简介</text>
				</view>
			</view>
		 -->
      </view>
    </view>
    <view class="bottom" v-if="type != 1 && userid != id">
      <view class="phone" @tap="boHao()">
        <image src="../../images/circle/phone1.png" mode="aspectFill"></image>
        <text>电话</text>
      </view>
      <view class="shoucang" v-if="cardData.isCollection == 0" @tap="shoucang">
        <image
          src="../../images/circle/shoucang1.png"
          mode="aspectFill"
        ></image>
        <text>收藏</text>
      </view>
      <view
        class="shoucang"
        v-if="cardData.isCollection == 1"
        @tap="noshoucang"
      >
        <image src="../../imges/yishoucang.png" mode="aspectFill"></image>
        <text style="color: #e8950d">已收藏</text>
      </view>
      <view class="share" @tap="openShare">
        <image src="../../images/circle/share1.png" mode="aspectFill"></image>
        <text>分享</text>
      </view>
    </view>
    <view class="bj" v-if="type == 1 || id == userid">
      <view class="itemM" @tap="openShare"> 分享名片 </view>
      <navigator
        url="/pages/per_center/editData"
        hover-class="none"
        class="itemM"
      >
        编辑名片
      </navigator>
    </view>
    <view class="btn" @tap="jiaohuan" v-else-if="cardData.isExchangeCards == 0">
      交换名片
    </view>
    <!-- 分享提示弹窗 -->
    <view class="fenxiang_" v-if="isLinkShare" @tap="closeLinkShare">
      <view class="content_">
        <view class="left_">
          <view class="one_"> 请点击右上角按钮“···” </view>
          <view class="two_"> 发送给好友，分享到朋友圈 </view>
        </view>
        <view class="right_">
          <image
            src="../../images/aliang/fenxiang.png"
            mode="aspectFill"
          ></image>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import request from "../../utils/request.js";
import "../../utils/toApp.js";
var jweixin = require("jweixin-module"); //配置
export default {
  data() {
    return {
      cardData: {},
      id: "",
      userid: "",
      type: "",
      exchange: true,
      goAdd: false,
      isShare: false,
      isLinkShare: false,
      isMore: false,
      cardInfoList: [
        {
          imgUrl: require("../../images/circle/renzhen.png"),
          title: "认证：",
          name: "",
        },
        {
          imgUrl: require("../../images/circle/dengji.png"),
          title: "等级：",
          name: "",
        },
        {
          imgUrl: require("../../images/circle/city.png"),
          title: "城市：",
          name: "",
        },
        // {
        // 	imgUrl: require('../../images/circle/company.png'),
        // 	title: '公司：',
        // 	name: ''
        // },
        {
          imgUrl: require("../../images/circle/hangye.png"),
          title: "行业：",
          name: "",
        },
        // {
        // 	imgUrl: require('../../images/circle/post.png'),
        // 	title: '职位：',
        // 	name: ''
        // },
        {
          imgUrl: require("../../images/circle/email.png"),
          title: "邮箱：",
          name: "",
        },
        {
          imgUrl: require("../../images/circle/sr.png"),
          title: "生日：",
          name: "",
        },
        {
          imgUrl: require("../../images/circle/jianjie.png"),
          title: "简介：",
          name: "",
        },
      ],
      cardNewInfoList: [],
    };
  },
  onShow() {
    this.isLinkShare = false;
    let token = uni.getStorageSync("token");
    if (token) {
      this.usercard();
      this.card();
    }
  },
  onLoad(option) {
    let token = uni.getStorageSync("token");
    this.id = option.id;
    this.type = option.type;
    if (option.isShare == 1) {
      this.isShare = true;
      if (!token) {
        this.wuTokenCard();
      } else {
        // this.card();
      }
    }
  },
  methods: {
    hanldeLess() {
      this.isMore = false;
      this.cardInfoList = this.cardNewInfoList.slice(0, 2);
    },
    hanldeMore() {
      this.isMore = true;
      this.cardInfoList = this.cardNewInfoList;
    },
    boHao() {
      let that = this;
      if (that.cardData.isExchangeCards == 0) {
        uni.showToast({
          title: "请先交换名片",
          duration: 2000,
          icon: "none",
        });
        return false;
      }
      let token = uni.getStorageSync("token");
      if (!token) {
        uni.showToast({
          title: "请授权登录再操作！",
          duration: 2000,
          icon: "none",
        });
        setTimeout(() => {
          uni.navigateTo({
            url: "/pages/index/index",
          });
        }, 2000);
        return false;
      }
      // 判断是否是手机号
      let phoneH = /^(((1[0-9][0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
      if (phoneH.test(that.cardData.telphone)) {
        uni.makePhoneCall({
          phoneNumber: that.cardData.telphone, //仅为示例
        });
      } else {
        uni.showToast({
          title: "该用户已设置了隐藏手机",
          duration: 2000,
          icon: "none",
        });
      }
    },
    shareto() {
      //打开分享
      //分享功能
      let that = this;
      this.request({
        url: "h5/login/jsapiSignature",
        method: "POST",
        header: {
          "Content-Type": "application/json",
          "api-client": "72e0fee8172411ea995200163e05ff66",
          "api-version": this.globalData.apiVersion,
          "Source-Type": 7, //post一定要带这个header，被这里坑了半天
        },
        data: {
          url: window.location.href.split("#")[0],
        },
      }).then((res) => {
        if (res.statusCode == 200) {
          jweixin.config({
            debug: false,
            appId: res.data.appId, // 必填，公众号的唯一标识
            timestamp: res.data.timestamp, // 必填，生成签名的时间戳
            nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
            signature: res.data.signature, // 必填，签名，见附录1
            jsApiList: ["updateAppMessageShareData", "updateTimelineShareData"],
          });
          jweixin.ready(function () {
            let imgZ = that.cardData.avatarUrl;
            let titleZ = "";
            let descZ = "";
            let linkZ =
              that.globalData.domain +"/pages/index/personal?id=" +
              that.id +
              "&isShare=1";
            if (that.id === that.userid) {
              titleZ = "您好，我是" + that.cardData.realName
			  descZ = "这是我的名片，为方便交流，请惠存！"
            } else {
              titleZ = "这是" + that.cardData.realName + "的名片，推荐给你";
              if (that.cardData.company || that.cardData.post) {
                descZ =
                  that.cardData.company +
                  that.cardData.post +
                  "，为方便交流，请惠存";
              } else {
                descZ = "为方便交流，请惠存";
              }
            }
			if (that.id === that.userid) {
				jweixin.updateTimelineShareData({
				  title: "您好，我是" + that.cardData.realName + "，这是我的名片，为方便交流，请惠存！", //分享标题
				  desc: "", // 分享描述
				  link: linkZ, //分享链接
				  imgUrl: imgZ, //分享图标
				});
			}else{
				jweixin.updateTimelineShareData({
				  title: titleZ, //分享标题
				  desc: descZ, // 分享描述
				  link: linkZ, //分享链接
				  imgUrl: imgZ, //分享图标
				});
			}
            jweixin.updateAppMessageShareData({
              title: titleZ, //分享标题
              desc: descZ, // 分享描述
              link: linkZ, //分享链接
              imgUrl: imgZ, //分享图标
            });
          });
        } else {
          uni.showToast({
            title: res.data.msg,
            duration: 2000,
            icon: "none",
          });
        }
      });
    },
    openShare() {
      // let token = uni.getStorageSync("token");
      // if (!token) {
      //   uni.showToast({
      //     title: "请授权登录再操作！",
      //     duration: 2000,
      //     icon: "none",
      //   });
      //   setTimeout(() => {
      //     uni.navigateTo({
      //       url: "/pages/index/index",
      //     });
      //   }, 2000);
      //   return false;
      // }
      this.isLinkShare = true;
      this.shareto();
    },
    closeLinkShare() {
      this.isLinkShare = false;
    },
    //jdk配置
    configWeiXin() {
      let _this = this;
      //获取公众号配置
      request({
        //获取appid
        url: "h5/login/jsapiSignature",
        method: "POST",
        header: {
          "Content-Type": "application/json",
          "api-client": "72e0fee8172411ea995200163e05ff66",
          "api-version": this.globalData.apiVersion,
          "Source-Type": 7,
        },
        data: {
          url: window.location.href.split("#")[0], //后台通过域名进行授权
        },
      }).then((res) => {
        var jsApiList = [
          "onMenuShareAppMessage",
          "onMenuShareTimeline",
          "updateAppMessageShareData",
          "updateTimelineShareData",
          "hideOptionMenu",
          "showOptionMenu",
        ];
        if (res.statusCode == 200) {
          //获取成功
          jweixin.config({
            debug: false, // 开启调试模式，发布的时候改为false
            appId: res.data.appId, // 必填，公众号的唯一标识
            timestamp: res.data.timestamp, // 必填，生成签名的时间戳
            nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
            signature: res.data.signature, // 必填，签名
            jsApiList: jsApiList, // 必填，需要使用的JS接口列表
          });
          jweixin.ready(function () {
            //配置成功
            _this.wxJsdkAuthorize(res.data.appId); //调用公众号-授权
          });
        } else {
          uni.showToast({
            title: res.data.msg,
            duration: 2000,
            icon: "none",
          });
        }
      });
    },
    //公众号授权
    wxJsdkAuthorize(_appid) {
      //授权时会跳到微信的页面，然后会自动调回来带着一个code
      let link = window.location.href;
      let _code = "";
      if (link.includes("code=")) {
        _code = link.split("code=")[1].split("&")[0];
      }
      // 如果拿到_code，传到后台
      if (_code) {
        request({
          url: "h5/login/getOpenIdV2", //拿oponid h5/loginapptoken/getOpenId(老版)
          method: "POST",
          header: {
            "Content-Type": "application/json",
            "api-client": "72e0fee8172411ea995200163e05ff66",
            "api-version": this.globalData.apiVersion,
            "Source-Type": 7,
          },
          data: {
            code: _code,
          },
        }).then((res) => {
          if (res.data.code == 200) {
            if (res.data.data.isLogin == false) {
            } else {
              uni.setStorageSync("token", res.data.data.token); //缓存token'
              uni.setStorageSync("personal", res.data.data);
              uni.showToast({
                title: "登录成功",
                duration: 1500,
                icon: "none",
              });
            }
          } else {
            // uni.showToast({
            //   title: "微信授权失效，请关闭重试",
            //   duration: 2000,
            //   icon: "none",
            // });
          }
        });
      } else {
        let appid = _appid;
        let uri = encodeURIComponent(link);
        let authURL = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${uri}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`;
        window.location.href = authURL;
      }
    },
    shoucang() {
      let token = uni.getStorageSync("token");
      const that = this;
      if (!token) {
        uni.showToast({
          title: "请授权登录再操作！",
          duration: 2000,
          icon: "none",
        });
        setTimeout(() => {
          uni.navigateTo({
            url: "/pages/index/index",
          });
        }, 2000);
      } else if (this.cardData.pullBlack == 1) {
        uni.showModal({
          title: "提示",
          content: "您已被该用户拉黑，Ta的相关信息将对您保密。",
          confirmText: "确定",
          success: (res) => {
            if (res.confirm) {
            }
          },
        });
      } else {
        request({
          url: "h5/home/addCollections?uid=",
          method: "POST",
          header: {
            "content-type": "application/json;charset=UTF-8",
            "api-client": "72e0fee8172411ea995200163e05ff66",
            "api-version": this.globalData.apiVersion,
            "Source-Type": 7,
            token: token,
          },
          data: {
            type: 9,
            collectionId: this.id,
          },
        }).then((res) => {
          if (res.data.code == 200) {
            that.card();
            uni.showToast({
              title: "收藏成功",
              duration: 2000,
              icon: "none",
            });
          } else if (res.data.code == 401) {
            uni.showToast({
              title: "登录失效，请重新授权登录！",
              duration: 2000,
              icon: "none",
            });
            setTimeout(() => {
              uni.navigateTo({
                url: "/pages/index/index",
              });
            }, 2000);
          } else {
            uni.showToast({
              title: res.data.msg,
              duration: 2000,
              icon: "none",
            });
          }
        });
      }
    },
    noshoucang() {
      let token = uni.getStorageSync("token");
      const that = this;
      if (!token) {
        uni.showToast({
          title: "请授权登录再操作！",
          duration: 2000,
          icon: "none",
        });
        setTimeout(() => {
          uni.navigateTo({
            url: "/pages/index/index",
          });
        }, 2000);
      } else if (this.cardData.pullBlack == 1) {
        uni.showModal({
          title: "提示",
          content: "您已被该用户拉黑，Ta的相关信息将对您保密。",
          confirmText: "确定",
          success: (res) => {
            if (res.confirm) {
            }
          },
        });
      } else {
        request({
          url: "h5/home/removeCollections?uid=",
          method: "POST",
          header: {
            "content-type": "application/json;charset=UTF-8",
            "api-client": "72e0fee8172411ea995200163e05ff66",
            "api-version": this.globalData.apiVersion,
            "Source-Type": 7,
            token: token,
          },
          data: {
            type: 9,
            collectionId: this.id,
          },
        }).then((res) => {
          if (res.data.code == 200) {
            that.card();
            uni.showToast({
              title: "已取消",
              duration: 2000,
              icon: "none",
            });
          } else if (res.data.code == 401) {
            uni.showToast({
              title: "登录失效，请重新授权登录！",
              duration: 2000,
              icon: "none",
            });
            setTimeout(() => {
              uni.navigateTo({
                url: "/pages/index/index",
              });
            }, 2000);
          } else {
            uni.showToast({
              title: res.data.msg,
              duration: 2000,
              icon: "none",
            });
          }
        });
      }
    },
    handleTui() {
      let ios = uni.getStorageSync("ios");
      if (this.goAdd || ios == 1) {
        uni.removeStorageSync("ios");
        window.history.go(-2);
      } else if (this.isShare) {
        uni.redirectTo({
          url: "/pages/index/index",
        });
      } else {
        window.history.back();
      }
    },
    jiaohuan() {
      if (this.exchange == false) {
        uni.showToast({
          title: "已提交申请，请勿重复操作",
          duration: 2000,
          icon: "none",
        });
        return false;
      }
      let token = uni.getStorageSync("token");
      const that = this;
      if (!token) {
        uni.showToast({
          title: "请授权登录再操作！",
          duration: 2000,
          icon: "none",
        });
        setTimeout(() => {
          uni.navigateTo({
            url: "/pages/index/index",
          });
        }, 2000);
      } else {
        request({
          url: "h5/userInformation/userExchangeCard",
          method: "POST",
          header: {
            "content-type": "application/json;charset=UTF-8",
            "api-client": "72e0fee8172411ea995200163e05ff66",
            "api-version": this.globalData.apiVersion,
            "Source-Type": 7,
            token: token,
          },
          data: {
            viewUid: this.id,
          },
        }).then((res) => {
          if (res.data.code == 200) {
            this.exchange = false;
            this.card();
            uni.showToast({
              title: "提交成功",
              duration: 2000,
              icon: "none",
            });
          } else if (res.data.code == 401) {
            uni.showToast({
              title: "登录失效，请重新授权登录！",
              duration: 2000,
              icon: "none",
            });
            setTimeout(() => {
              uni.navigateTo({
                url: "/pages/index/index",
              });
            }, 2000);
          } else {
            uni.showToast({
              title: res.data.msg,
              duration: 2000,
              icon: "none",
            });
          }
        });
      }
    },
    usercard() {
      let token = uni.getStorageSync("token");
      const that = this;
      if (!token) {
        uni.showToast({
          title: "请授权登录再操作！",
          duration: 2000,
          icon: "none",
        });
        setTimeout(() => {
          uni.navigateTo({
            url: "/pages/index/index",
          });
        }, 2000);
      } else {
        request({
          url: "h5/userInformation/getNewOtherBusinessCard?",
          method: "POST",
          header: {
            "content-type": "application/json;charset=UTF-8",
            "api-client": "72e0fee8172411ea995200163e05ff66",
            "api-version": this.globalData.apiVersion,
            "Source-Type": 7,
            token: token,
          },
          data: {
            viewUid: "",
          },
        }).then((res) => {
          if (res.data.code == 200) {
            that.userid = res.data.data.id;
          } else if (res.data.code == 401) {
            uni.showToast({
              title: "登录失效，请重新授权登录！",
              duration: 2000,
              icon: "none",
            });
            setTimeout(() => {
              uni.navigateTo({
                url: "/pages/index/index",
              });
            }, 2000);
          } else {
            uni.showToast({
              title: res.data.msg,
              duration: 2000,
              icon: "none",
            });
          }
        });
      }
    },
    card() {
      let token = uni.getStorageSync("token");
      const that = this;
      if (!token) {
        uni.showToast({
          title: "请授权登录再操作！",
          duration: 2000,
          icon: "none",
        });
        setTimeout(() => {
          uni.navigateTo({
            url: "/pages/index/index",
          });
        }, 2000);
      } else {
        request({
          url: "h5/userInformation/getNewOtherBusinessCard?",
          method: "POST",
          header: {
            "content-type": "application/json;charset=UTF-8",
            "api-client": "72e0fee8172411ea995200163e05ff66",
            "api-version": this.globalData.apiVersion,
            "Source-Type": 7,
            token: token,
          },
          data: {
            viewUid: this.id,
          },
        }).then((res) => {
          if (res.data.code == 200) {
            that.cardData = res.data.data;
            that.shareto();
            that.cardInfoList = [
              {
                imgUrl: require("../../images/circle/renzhen.png"),
                title: "认证：",
                name: res.data.data.verified,
              },
              {
                imgUrl: require("../../images/circle/dengji.png"),
                title: "等级：",
                name: "Lv" + res.data.data.memberLevel,
              },
              {
                imgUrl: require("../../images/circle/city.png"),
                title: "城市：",
                name: res.data.data.address,
              },
              // {
              // 	imgUrl: require('../../images/circle/company.png'),
              // 	title: '公司：',
              // 	name: res.data.data.company
              // },
              {
                imgUrl: require("../../images/circle/hangye.png"),
                title: "行业：",
                name: res.data.data.industry,
              },
              // {
              // 	imgUrl: require('../../images/circle/post.png'),
              // 	title: '职位：',
              // 	name: res.data.data.post
              // },
              {
                imgUrl: require("../../images/circle/email.png"),
                title: "邮箱：",
                name: res.data.data.mail,
              },
              {
                imgUrl: require("../../images/circle/sr.png"),
                title: "生日：",
                name: res.data.data.birthday
                  ? res.data.data.birthday.substring(0, 4) +
                    " / " +
                    res.data.data.birthday.substring(5, 7) +
                    " / " +
                    res.data.data.birthday.substring(8, 10)
                  : "",
              },
              {
                imgUrl: require("../../images/circle/jianjie.png"),
                title: "简介：",
                name: res.data.data.selfIntroduction,
              },
            ];
            that.cardNewInfoList = that.cardInfoList.filter((v) => {
              return v.name != "";
            });
            if (!that.isMore) {
              that.cardInfoList = that.cardNewInfoList.slice(0, 2);
            }
          } else if (res.data.code == 401) {
            that.configWeiXin();
          } else {
            uni.showToast({
              title: res.data.msg,
              duration: 2000,
              icon: "none",
            });
          }
        });
      }
    },
    wuTokenCard() {
      const that = this;
      request({
        url: "h5/userInformation/shareBusinessCard?",
        method: "POST",
        header: {
          "content-type": "application/json;charset=UTF-8",
          "api-client": "72e0fee8172411ea995200163e05ff66",
          "api-version": this.globalData.apiVersion,
          "Source-Type": 7,
        },
        data: {
          viewUid: that.id,
        },
      }).then((res) => {
        if (res.data.code == 200) {
          that.cardData = res.data.data;
          that.shareto();
          that.cardInfoList = [
            {
              imgUrl: require("../../images/circle/renzhen.png"),
              title: "认证：",
              name: res.data.data.verified,
            },
            {
              imgUrl: require("../../images/circle/dengji.png"),
              title: "等级：",
              name: "Lv" + res.data.data.memberLevel,
            },
            {
              imgUrl: require("../../images/circle/city.png"),
              title: "城市：",
              name: res.data.data.address,
            },
            // {
            // 	imgUrl: require('../../images/circle/company.png'),
            // 	title: '公司：',
            // 	name: res.data.data.company
            // },
            {
              imgUrl: require("../../images/circle/hangye.png"),
              title: "行业：",
              name: res.data.data.industry,
            },
            // {
            // 	imgUrl: require('../../images/circle/post.png'),
            // 	title: '职位：',
            // 	name: res.data.data.post
            // },
            {
              imgUrl: require("../../images/circle/email.png"),
              title: "邮箱：",
              name: res.data.data.mail,
            },
            {
              imgUrl: require("../../images/circle/sr.png"),
              title: "生日：",
              name: res.data.data.birthday
                ? res.data.data.birthday.substring(0, 4) +
                  " / " +
                  res.data.data.birthday.substring(5, 7) +
                  " / " +
                  res.data.data.birthday.substring(8, 10)
                : "",
            },
            {
              imgUrl: require("../../images/circle/jianjie.png"),
              title: "简介：",
              name: res.data.data.selfIntroduction,
            },
          ];
          that.cardNewInfoList = that.cardInfoList.filter((v) => {
            return v.name != "";
          });
          that.cardInfoList = that.cardNewInfoList.slice(0, 2);
        } else if (res.data.code == 401) {
          uni.showToast({
            title: "登录失效，请重新授权登录！",
            duration: 2000,
            icon: "none",
          });
          setTimeout(() => {
            uni.navigateTo({
              url: "/pages/index/index",
            });
          }, 2000);
        } else {
          uni.showToast({
            title: res.data.msg,
            duration: 2000,
            icon: "none",
          });
        }
      });
    },
  },
};
</script>

<style lang="less" scoped>
/deep/.uni-app--maxwidth {
  background: #f6f6f6 !important;
}

uni-page-body,
uni-page-refresh {
  background: #f6f6f6;
}

.main {
  width: 100%;
  min-height: 100vh;
  padding: 128rpx 36rpx 0 36rpx;
  background: #f6f6f6;
  // margin-top: 20rpx;
  box-sizing: border-box;
}

.fenxiang_ {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);

  .footer_content {
    position: absolute;
    bottom: -2rpx;
    left: 0;
    width: 750rpx;
    height: 200rpx;
    opacity: 1;
    background: #f7f7f7;
    display: flex;
    padding-top: 28rpx;
    justify-content: center;

    // align-items: center;
    .item_ {
      display: flex;
      flex-direction: column;
      align-items: center;

      image {
        width: 100rpx;
        height: auto;
      }

      text {
        font-size: 26rpx;
        font-family: PingFangSC, PingFangSC-Regular;
        font-weight: 400;
        // text-align: left;
        color: #111111;
      }
    }

    .item_imgShare {
      padding: 0 112rpx;
    }
  }

  .content_ {
    width: 690rpx;
    height: 200rpx;
    background: #ffffff;
    border-radius: 8rpx;
    position: absolute;
    top: 30rpx;
    left: 32rpx;
    padding: 46rpx 32rpx;
    padding-right: 56rpx;
    box-sizing: border-box;
    z-index: 99999;
    display: flex;
    justify-content: space-between;

    .left_ {
      display: flex;
      flex-direction: column;
      justify-content: space-between;

      .one_ {
        font-size: 36rpx;
        font-family: PingFangSC, PingFangSC-Medium;
        font-weight: 500;
        // text-align: center;
        color: #000000;
      }

      .two_ {
        font-size: 32rpx;
        font-family: PingFangSC, PingFangSC-Regular;
        font-weight: 400;
        // text-align: center;
        color: #999999;
      }
    }

    .right_ {
      height: 69rpx;
      width: 70rpx;

      image {
        width: 100%;
        height: 100%;
      }
    }
  }
}

.top_tou {
  display: flex;
  padding: 0 38rpx;
  width: 750rpx;
  height: 92rpx;
  background: #ffffff;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  box-sizing: border-box;

  .left_ {
    image {
      height: 40rpx;
      width: 40rpx;
    }
  }

  .center_ {
    font-size: 36rpx;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 500;
    text-align: center;
    color: #111111;
  }

  .right_ {
    width: 18rpx;
  }
}

.content {
  width: 100%;
  background: #ffffff;
  padding: 0 40rpx;
  padding-top: 70rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  border-radius: 4rpx;
  .photo {
    width: 284rpx;
    height: 284rpx;
    position: relative;
    margin-bottom: 56rpx;

    .tou {
      width: 284rpx;
      height: 284rpx;
    }

    .v {
      width: 48rpx;
      height: 48rpx;
      position: absolute;
      bottom: -6rpx;
      right: -14rpx;
      z-index: 9;
    }
  }

  .name {
    font-size: 48rpx;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: bold;
    text-align: left;
    color: #111111;
    line-height: 67rpx;
    margin-bottom: 10rpx;
  }

  .xinxi {
    font-size: 32rpx;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: center;
    color: #111111;
    line-height: 45rpx;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    .company {
      margin-right: 20rpx;
    }
  }
  .tab {
    width: 100%;
    height: 80rpx;
    display: flex;
    justify-content: space-between;
    border-bottom: 1rpx solid #dddddd;
    font-size: 28rpx;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #111111;
    line-height: 40rpx;
    margin-top: 56rpx;
    margin-bottom: 50rpx;

    .zhuzi,
    .quanzi,
    .card {
      height: 48rpx;
      display: flex;
      align-items: center;
    }

    .t1 {
      font-size: 34rpx;
      font-family: PingFangSC, PingFangSC-Semibold;
      font-weight: bold;
      text-align: left;
      color: #111111;
      line-height: 48rpx;
      margin-left: 12rpx;
    }
  }

  .message {
    transition: all 1s ease-out;
    width: 100%;
    font-size: 28rpx;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #111111;
    line-height: 40rpx;
    margin-bottom: 42rpx;
    position: relative;

    .openMore {
      width: 40rpx;
      height: 40rpx;
      position: absolute;
      right: -6rpx;
      top: 50rpx;
    }

    .openMore1 {
      width: 40rpx;
      height: 40rpx;
      position: absolute;
      right: -6rpx;
      bottom: 12rpx;
    }

    img {
      width: 40rpx;
      height: 40rpx;
      margin-right: 10rpx;
    }

    .renzhen {
      width: 100%;
      display: flex;
      margin-bottom: 15rpx;
      word-break: break-all;
      transition: all 1s ease-out;

      > img {
        flex-shrink: 0;
      }

      .row {
        // max-width: 200rpx;
        transition: all 1s ease-out;
        word-break: break-all;
        display: flex;
        white-space: normal nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
      }
      .row1 {
        max-width: 485rpx;
        text-align: justify;
        // word-break:normal;word-wrap:break-word;
        // white-space: pre-wrap;
        word-break: normal;
        word-break: break-all;
        word-warp: break-word;
        white-space: pre-wrap;
        letter-spacing: 0.03rem;
        display: flex;
        .title {
          display: inline-block;
          min-width: 89rpx;
        }
        .brief {
          // word-wrap:break-word;
          display: inline-block;
          max-width: 400rpx;
        }
      }
    }
  }
}

.bottom {
  width: 100%;
  height: 160rpx;
  display: flex;
  justify-content: space-between;
  margin-top: 36rpx;

  .phone,
  .shoucang,
  .share {
    width: 218rpx;
    height: 160rpx;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;

    text {
      font-size: 24rpx;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: center;
      color: #111111;
      line-height: 33rpx;
      margin-top: 20rpx;
    }
  }

  .phone {
    image {
      width: 38rpx;
      height: 38rpx;
    }
  }

  .shoucang {
    image {
      width: 38rpx;
      height: 41rpx;
    }
  }

  .share {
    image {
      width: 44rpx;
      height: 44rpx;
    }
  }
}

.btn {
  width: 100%;
  height: 80rpx;
  border-radius: 4rpx;
  background: #0c5bfb;
  text-align: center;
  line-height: 80rpx;
  font-size: 32rpx;
  color: #ffffff;
  margin-top: 36rpx;
  font-family: PingFangSC, PingFangSC-Regular;
  font-weight: 400;
}

.bj {
  width: 100%;
  height: 80rpx;
  margin-top: 36rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20rpx;
  background-color: #f6f6f6;

  .itemM {
    width: 333rpx;
    height: 80rpx;
    opacity: 1;
    background: #ffffff;
    border-radius: 4rpx;
    line-height: 80rpx;
    text-align: center;
    opacity: 1;
    font-size: 32rpx;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    color: #0c5bfb;
  }
}
</style>
